import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/login",
      component: () => import('@/views/UserLogin.vue')
    },
    {
      path: '/register',
      component: () => import('@/views/UserRegister.vue')
    },
    {
      path: '/main',
      component: () => import('@/views/MainView.vue'),
      children: [

      ]
    },
    {
      path: '/detail/:id',
      component: () => import('@/views/GeneratorDetails.vue')
    },
    {
      path: '/information',
      component: () => import('@/views/InformationView.vue')
    },
    {
      path: '/add',
      component: () => import('@/views/AddGenerator.vue'),
      children: [
        {
          path: '/baseInformation',
          component: () => import('@/views/make/BaseInformation.vue')
        },
        {
          path: '/modelConfig',
          component: () => import('@/views/make/ModelConfig.vue')
        },
        {
          path: '/fileconfig',
          component: () => import('@/views/make/FileConfig.vue')
        },
        {
          path: '/generatefile',
          component: () => import('@/views/make/GeneratorFile.vue')
        }
      ]
    },
    {
      path: '/',
      redirect: '/information'
    }
  ],
})

export default router
